import Vue from "vue";
import VueRouter, { RouteConfig } from "vue-router";
import shareInfo from "./wx";
Vue.use(VueRouter);

const routes: Array<RouteConfig> = [
    {
        path: "/",
        component: () => import("../views/index/index.vue"),
    },
];

const router = new VueRouter({
    mode: "hash",
    base: process.env.BASE_URL,
    routes,
});
router.afterEach((to, from) => {
    if (process.env.NODE_ENV == "production") {
        shareInfo.init({
            title: document.title,
            desc: "全国医院综合/专科排行榜",
            img: "http://www.nbd.com.cn/corp/20201119yiyuan-rank/share.png",
            shareURL:location.href,
        });
    }
});
export default router;
